import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    message:'',
  },
  getters: {
    messagelength(state){
       return state.message.length 
    }
  },
  mutations: {
    keepingdirect(state, num) {
      state.message = num
    }
  },
  actions: {
    keepingdelay(text, num) {
      setTimeout(() => {
        text.commit('keepingdirect',num)
      }, 3000);
    }
  },
  modules: {
  }
})
